package com.mp.approvalreq.util;


import com.mp.approvalreq.entity.AppendSign;
import com.plusmoney.util.Utils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class AppendSignUtils {

	public static Map<Integer, AppendSign> getAppendSignMap(List<AppendSign> list) {
		return list.stream().collect(Collectors.toMap(AppendSign::getRequestId, appendSign -> appendSign, (a, b) -> b));
	}

	public static List<Integer> getRequestIds(List<AppendSign> appendSigns) {
		if (Utils.isEmpty(appendSigns)) {
			return new ArrayList<>();
		}
		return appendSigns.stream().map(AppendSign::getRequestId).collect(Collectors.toList());
	}
}
